package cn.tedu._05mvcboot02.Controller;

import cn.tedu._05mvcboot02.pojo.dto.UserDTOHomeWork;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class UserControllerHomeWork {
    @RequestMapping("/emp/insert")
    @ResponseBody
    public String insertUser(UserDTOHomeWork userDTO){
        String username=userDTO.getUsername();
        Double salary=userDTO.getSalary();
        String job=userDTO.getJob();
        return "添加成功("+username+":"+salary+":"+job+")";
    }

    @RequestMapping("/emp/select")
    @ResponseBody
    public String selectUser(){
        return "查询成功！";
    }

    @RequestMapping("/emp/update")
    @ResponseBody
    public String updateUser(Integer id,String username,Double salary,String job){
        return "修改成功("+id+":"+username+":"+salary+":"+job+")";
    }

    @RequestMapping("/emp/delete")
    @ResponseBody
    public String deleteUser(Integer id){
        return "删除成功("+id+")";
    }
}
